"""监控相关数据模型"""

from pydantic import BaseModel, Field
from typing import List, Optional

class MetricData(BaseModel):
    """监控指标数据模型"""
    labels: List[str] = Field(..., description="时间标签")
    values: List[float] = Field(..., description="指标值")

class NetworkMetrics(BaseModel):
    """网络监控指标模型"""
    labels: List[str] = Field(..., description="时间标签")
    in_values: List[float] = Field(..., description="网络流入值")
    out_values: List[float] = Field(..., description="网络流出值")

class MonitorData(BaseModel):
    """监控数据响应模型"""
    cpu: MetricData = Field(..., description="CPU使用率")
    memory: MetricData = Field(..., description="内存使用率")
    network: NetworkMetrics = Field(..., description="网络流量")

class MonitorQuery(BaseModel):
    """监控查询参数模型"""
    instance_id: str = Field(..., description="实例ID")
    metric_type: Optional[str] = Field("cpu,memory,network", description="指标类型")
    period: Optional[int] = Field(3600, description="时间范围(秒)")
